/**
 * Copyright(C) 2013 HSP Software Company
 *
 * Api v 1.0 2013/11/11 03:43:05 Hung  

 */
package org.xbmc.net;

import java.io.UnsupportedEncodingException;
import java.util.ArrayList;

import org.xbmc.android.util.JsonParsingUtils;
import org.xbmc.api.object.MusicAlbumVideoList;
import org.xbmc.api.object.MusicCategoryList;
import org.xbmc.constants.IKeyConstants;
import org.xbmc.constants.INetConstants;
import org.xbmc.net.RestClient.RequestMethod;

/**
 * giao tiếp Api giữa server và client thông qua các hàm Api của class
 * 
 * @author Thanh
 * 
 */
public class ApiUtils implements INetConstants, IKeyConstants {

	private static final String TAG = null;

	public static ArrayList<MusicCategoryList> getMusicCategory() {
		RestClient mRestClient = new RestClient(END_POINT
				+ METHOD_MUSIC_CATEGORY_LIST);
		try {
			mRestClient.excute(RequestMethod.GET);
			String response = mRestClient.getResponse();
			// Log.d(TAG, "-----------> response = " + response);
			return JsonParsingUtils.parseListMusicCategory(response);
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		return null;
	}
	
	public static ArrayList<MusicAlbumVideoList> getMusicAlbum() {
		RestClient mRestClient = new RestClient(END_POINT
				+ METHOD_MUSIC_ALBUM_LIST);
		try {
			mRestClient.excute(RequestMethod.GET);
			String response = mRestClient.getResponse();
			// Log.d(TAG, "-----------> response = " + response);
			return JsonParsingUtils.parseListMusicAlbum(response);
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		return null;
	}

}
